﻿/*
 * This file is part of CommunitySettlers.
 *
 * CommunitySettlers is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * CommunitySettlers is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with CommunitySettlers.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Author: Christoph Husse
 * 
 * Also checkout our homepage: http://communitysettlers.codeplex.com/
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Drawing;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace SettlersEngine
{
    public enum StackDirection
    {
        Incoming,
        Outgoing,
    }

    public enum BuildingType
    {
        Default,
        Market,
    }

    public interface IRaceConfig
    {
        ReadOnlyCollection<BuildingConfig> Buildables { get; }
    }

    public class ResourceStackConfig
    {
        public System.Windows.Point DoublePosition { get; set; }

        public Resource Type { get; set; }
        public Int32 TimeOffset { get; set; }
        public Int32 CycleCount { get; set; }
        public Int32 MaxStackSize { get; set; }
        public Int32 QualityIndex { get; set; }
        public StackDirection Direction { get; set; }
    }

    public class BuildingConfig
    {
        public Int32 TypeIndex { get; set; }
        public Int32 SettlerCount { get; set; }
        public String Name { get; set; }
        public String AnimationClass { get; set; }
        public Boolean NoProductionRange { get; set; }
        public List<ResourceStackConfig> ResourceStacks { get; set; }
        public List<System.Drawing.Rectangle> SolidBoundaries { get; set; }
        public Int32 DamageResistance { get; set; }
        public Int32 WoodCount { get; set; }
        public Int32 StoneCount { get; set; }
        public Int32 ProductionTimeMillis { get; set; }
        public int VisualWidth { get; set; }
        public int VisualHeight { get; set; }
        public Rectangle LockedBounds { get; set; }
        public BuildingType BuiltinType { get; set; }

        public BuildingConfig()
        {
            ResourceStacks = new List<ResourceStackConfig>();
            SolidBoundaries = new List<Rectangle>();
        }
    }

}
